<%@ page contentType="text/html;charset=utf-8"%>
<%@ page pageEncoding="utf8"%>
<%@ page import="net.sureon.web.*"%>
<%@ page import="net.sureon.biz.*"%>

<%
	CompanyBO companyBO = null;
	companyBO = (CompanyBO) request.getAttribute("companyBO");

	CompanyForm cf = new CompanyForm();
	cf.setAdminEmail(companyBO.getCompanyVO().getAdminEmail());
	cf.setAdminName(companyBO.getCompanyVO().getAdminName());

	String adminTel = companyBO.getCompanyVO().getAdminTel();
	String adminFax = companyBO.getCompanyVO().getAdminFax();
	if (adminTel != null && !"".equals(adminTel)) {
		String[] strs = adminTel.split("-");
		if (strs.length == 2) {
			cf.setAdminTel1(strs[0]);
			cf.setAdminTel2(strs[1]);
		}
	}

	if (adminFax != null && !"".equals(adminFax)) {
		String[] adminFaxs = adminFax.split("-");
		if (adminFaxs.length == 2) {
			cf.setAdminFax1(adminFaxs[0]);
			cf.setAdminFax2(adminFaxs[1]);
		}
	}

	cf.setCompanyAddress(companyBO.getCompanyVO().getCompanyAddress());
	cf
			.setCompanyFullName(companyBO.getCompanyVO()
					.getCompanyFullName());
	cf.setCompanyZipCode(companyBO.getCompanyVO().getCompanyZipCode());
	// cf.setRealName(companyBO.getCompanyVO().getAdminName());
	cf.setCompanyID(companyBO.getCompanyID());
	cf.setSiteURL(companyBO.getCompanyVO().getSiteURL());

	cf.setAdminTitle(companyBO.getCompanyVO().getAdminTitle());
	cf.setAdminName(companyBO.getCompanyVO().getAdminName());
	cf.setCompanyWebSite(companyBO.getCompanyVO().getCompanyWebSite());
	
	cf.setCompanyID(companyBO.getCompanyID());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<!-- InstanceBegin template="/Templates/StaticTemplet.dwt" codeOutsideHTMLIsLocked="false" -->
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<!-- InstanceBeginEditable name="doctitle" -->
		<title>免费注册</title>
		<!-- InstanceEndEditable -->
		<!-- InstanceBeginEditable name="head" -->
		<!-- InstanceEndEditable -->
		<style type="text/css">
<!--
body {
	margin: 6px 8px 4px 8px;
	background: #FFF
}

body,div,td {
	font-family: Arial;
	font-size: 12px;
	line-height: 18px;
}

form {
	margin: 0
}

a:link {
	color: #255f9f
}

a:visited {
	color: #255f9f
}

#main {
	width: 100%
}

#hd {
	margin-bottom: 10px;
	width: 100%;
	border: 0
}

#hd .lg {
	margin: 0 7px 0 7px;
	border: 0
}

#hd .tit {
	font-family: "黑体";
	font-size: 20px;
	line-height: 24px;
	padding: 22px 10px 0 0;
	white-space: nowrap
}

#hd .usrbar {
	padding-right: 10px;
	text-align: right;
	white-space: nowrap
}

#hd .tt {
	background: #61a3d7 url(../images/hd_l.gif) no-repeat left;
	padding-left: 10px;
	font-size: 14px;
	font-weight: bold;
	color: #fff;
	height: 25px;
	line-height: 25px;
	margin-top: 21px
}

#hd .tt .r {
	float: right;
	width: 2px;
	background: url(../images/hd_r.gif) no-repeat right;
	line-height: 0px;
	height: 25px
}

.f14 {
	font-size: 14px;
	line-height: 24px
}

.f12 {
	font-size: 12px;
	line-height: 18px
}

#nav {
	background: #61a3d7;
	margin-bottom: 20px;
}

#nav .l {
	background: url(../images/nav_l.gif);
	width: 4px;
}

#nav .r {
	background: url(../images/nav_r.gif);
	width: 4px;
}

#nav .c {
	border-top: 1px solid #3277ae;
	border-bottom: 1px solid #3277ae;
	padding-left: 2px;
	color: #000000;
}

#nav a,#nav a:hover,#nav span {
	padding: 5px 15px 1px 15px;
	font-size: 14px;
	font-weight: bold;
	float: left
}

#nav a,#nav a:hover {
	color: #FFFFFF;
	text-decoration: none;
}

#nav span,#nav a.current {
	background: #dfedf8;
	color: #000000;
	line-height: 16px;
	height: 19px;
	position: relative;
	top: 1px
}

#tabline {
	position: relative;
	top: 25px;
	margin-left: 0px;
	height: 1px;
	line-height: 1px;
	background-color: #c4ddf0;
	font-size: 0px
}

#tab {
	position: relative;
	height: 25px;
	margin-left: 7px
}

#tab span,#tab a {
	float: left;
	margin-left: 5px;
	border-color: #c4ddf0;
	border-style: solid;
	border-width: 1px 1px 0 1px;
	font-size: 14px;
	line-height: 18px
}

#tab span {
	background: #ffffff;
	padding: 4px 8px 2px 8px;
	font-weight: bold
}

#tab a {
	background: #e8f0f6;
	padding: 3px 9px 2px 9px;
}

.tit_1,.tit_3 {
	font-size: 14px;
	height: 25px;
	line-height: 25px;
	padding-left: 15px;
	padding-right: 15px;
}

.tit_1 {
	margin-bottom: 8px;
	background: #f1f8ff
}

.tit_2 {
	height: 25px;
	line-height: 25px;
	padding: 0 5px 0 5px;
	background: #deebfb
}

.tit_3 {
	background: #deebfb;
	border: 1px solid #c4deef;
	border-bottom: 0px;
}

.box_1,.box_2 {
	border: 1px solid #c4deef;
}

.box_2 {
	border-top: 0px;
	padding: 10px;
	line-height: 22px
}

.table_1 {
	border-left: 1px solid #cccccc;
	border-top: 1px solid #cccccc;
}

.table_1 td {
	border-right: 1px solid #cccccc;
	border-bottom: 1px solid #cccccc;
	line_height: 25px;
	padding-left: 10px
}

.table_2 td {
	border-bottom: 1px solid #cccccc;
	line_height: 25px;
	padding: 5px 0 5px 10px;
}

.table_3 td {
	border-bottom: 0;
	line_height: 25px;
	padding: 5px 0 5px 0;
}

.table_4 td {
	border-bottom: 1px solid #cccccc;
	line_height: 25px;
	padding: 5px 0 5px 15px;
}

.pad_1 {
	padding-left: 15px;
	padding-right: 15px
}

.pad_2 {
	padding-left: 5px;
	padding-right: 5px
}

.pad_3 {
	padding: 6px 0 4px 0
}

.pad_4 {
	padding: 7px 10px 3px 15px
}

.pad_5 {
	padding-left: 10px;
	padding-right: 10px
}

.pad_6 {
	padding: 7px 10px 15px 15px
}

.mar_1 {
	margin-top: 10px;
}

.col_1,.col_1:link,.col_1:visited {
	color: #666666;
}

.col_2,.col_2:link,.col_2:visited {
	color: #cd0304
}

.col_3,.col_3:link,.col_3:visited {
	color: #ff0000
}

.col_4,.col_4:link,.col_4:visited {
	color: #009933
}

.col_5,.col_5:link,.col_5:visited {
	color: #000000
}

.col_6,.col_6:link,.col_6:visited {
	color: #356501
}

.col_7,.col_6:link,.col_6:visited {
	color: #ff3101
}

.line_1 {
	border-top: 1px solid #cccccc;
	margin-top: 12px;
	line-height: 12px
}

.line_2 {
	border-top: 1px solid #c4deef;
	margin-top: 12px;
	line-height: 12px
}

.box_prompt {
	width: 80%;
	padding: 7px 30px 7px 30px;
	border: 1px solid #e67b33;
	background: #fff6df;
	color: #5f6a66;
	text-align: left;
	margin-bottom: 20px
}

.but1 {
	border: 1px solid #9aafe5;
	background-color: #ffffff;
	padding: 2px 4px 2px 4px;
	font-size: 12px;
	line-height: 25px
}

.but2 {
	border: 1px solid #9aafe5;
	background-color: #e2e9fc;
	padding: 2px 4px 3px 4px;
	font-size: 12px;
}

.but3 {
	padding: 1px 5px 1px 5px;
	font-size: 12px;
	line-height: 14px
}

sup {
	color: red;
	font-family: arial;
}

.butn1 {
	width: 130px;
	height: 22px;
	padding: 1px 5px 1px 5px;
	font-size: 12px;
}

.butn2 {
	width: 120px;
	height: 22px;
	padding: 1px 5px 1px 5px;
	font-size: 12px;
}

.butn3 {
	width: 60px;
	height: 22px;
	padding: 1px 5px 1px 5px;
	font-size: 12px;
}

.butn4 {
	width: 80px;
	height: 22px;
	padding: 1px 5px 1px 5px;
	font-size: 12px;
}

.butn5 {
	width: 100px;
	height: 22px;
	padding: 1px 5px 1px 5px;
	font-size: 12px;
}

.keysnum {
	font-size: 12px;
	color: #666666;
	float: right;
	padding-right: 5px;
}

/** add by xianlihua */
.regTit {
	margin: 15px 0 10px;
	padding-bottom: 2px;
	border-bottom: 1px solid #ADBEF2;
	font-weight: 700;
	color: #666
}

.input {
	width: 160px;
}

.bd {
	border: 1px solid #A5ACB2;
	height: 16px;
	_height: 18px;
	line-height: 18px;
	padding-top: 2px;
	_padding-top: 0;
	font-size: 12px;
}

.note {
	color: #666;
	margin-top: 2px
}

.error {
	color: #f00;
	margin: 4px 0 -4px
}

.cutline {
	height: 1px;
	font-size: 0;
	overflow: hidden;
	background-color: #ADBEF2;
	margin: 10px 0 8px
}

/**add by lizheng */
.pad_3 p {
	margin: 0
}

.pad_3 p span {
	color: #646464
}

.err {
	display: none
}

.valid p {
	margin: 0
}
-->
</style>

<script type="text/javascript">
	function checkForm() {
		if(document.registerInfoForm.siteURL.value == "") {
			alert('公司英文简写不能够为空！');
			return false;
		}
		if(document.registerInfoForm.adminEmail.value == "") {
			alert('Email不能够为空!');
			return false;
		}
		
		var re = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/ 
		if(!re.test(document.registerInfoForm.adminEmail.value)){
			alert("email格式不正确， 请正确填写.");
			return false;
		}
		if(document.registerInfoForm.adminName.value == "") {
			alert('联系人姓名不能够为空！');
			return false;
		}
		if(document.registerInfoForm.companyWebSite.value == "") {
			alert('公司网址不能够为空！');
			return false;
		}		
		if(document.registerInfoForm.companyFullName.value == "") {
			alert('公司名称不能够为空！');
			return false;
		}
		if(document.registerInfoForm.address.value == "") {
			alert('公司通信地址不能够为空！');
			return false;
		}
		if(document.registerInfoForm.adminTel1.value == "" || document.registerInfoForm.adminTel2.value == "") {
			alert('联系电话不能够为空！');
			return false;
		}

			
	return true;
		
}
</script>

	</head>

	<body>
	<jsp:include page="../header.jsp"></jsp:include>
		<table width="100%" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td colspan="3">
					<!-- InstanceBeginEditable name="EditRegion3" -->
					<%--
					<p>
						<strong>公司信息:</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<button  onclick="window.open('<%=request.getContextPath() %>/admin/manageGroup.do','','width=800,height=600')">团队管理</button>
					</p>
					--%>
					<form name="registerInfoForm" id="register"
						action="<%=request.getContextPath() + "/admin/registerInfo.do"%>"
						method="post" onsubmit="return checkForm();">
						<input type=hidden name=userlevel value=10101 />

						<table border="0" cellspacing="0" cellpadding="0" width="100%">
							<tr>

								<td valign="top" class="pad_3">
									<strong>公司英文简写&nbsp;*</strong>
									<br />
									<input name="siteURL" class="input bd" maxlength="32"
										value="<%=cf == null ? "" : (cf.getSiteURL() == null ? "" : cf
					.getSiteURL())%>"
										id="siteURL" readonly="readonly" />
									<br />
									<div class="note">
										公司英文简写，通俗名称， 用于登录系统，请正确填写
									</div>
								</td>
							</tr>

							<tr>
								<td valign="top" class="pad_3" colspan="2">
									<strong>电子邮件&nbsp;*</strong>
									<br />
									<p>
										<input name="adminEmail" class="input bd" maxlength="100"
											value="<%=cf == null ? "" : (cf.getAdminEmail() == null ? ""
					: cf.getAdminEmail())%>"
											id="email" readonly />
									</p>
									<p class="error"></p>
									<div class="note">
										最常用的邮件地址，作为用户名登录系统，例：abc@titaon.net
									</div>
								</td>
							</tr>
						</table>
						<div class="regTit">
							联系资料
						</div>

						<table border="0" cellspacing="0" cellpadding="0" width="100%">
							<tr>
								<td valign="top" class="pad_3">
									<strong>联系人姓名&nbsp;*</strong>
									<br />
									<p>
										<input name="adminName" size="12" class="bd" maxlength="50"
											value="<%=cf == null ? "" : (cf.getAdminName() == null ? ""
					: cf.getAdminName())%>"
											id="real_name" />
									</p>
									<p class="error"></p>
								</td>
								<td valign="top" class="pad_3">
									<strong>联系人职位</strong>
									<br />
									<p>
										<input name="adminTitle" size="12" class="bd" maxlength="50"
											value="<%=cf == null ? "" : (cf.getAdminTitle() == null ? ""
					: cf.getAdminTitle())%>"
											id="job" />
									</p>
									<p class="error"></p>
								</td>
							</tr>
							<tr>

								<td valign="top" class="pad_3" colspan="2">
									<strong>公司网址&nbsp;*</strong>
									<br />
									
										<input name="companyWebSite" style="width: 248px;" class="bd"
											maxlength="100"
											value="<%=cf == null ? ""
					: (cf.getCompanyWebSite() == null ? "" : cf
							.getCompanyWebSite())%>"
											id="companyWebSite" />
									<div class="note">
									<p />
										必须与网站上出现名称一致
										<div>
											
								</td>
							</tr>
							<tr>

								<td valign="top" class="pad_3" colspan="2">
									<strong>公司名称&nbsp;*</strong>
									<br />
									<input name="companyFullName" style="width: 248px;" class="bd"
										maxlength="100"
										value="<%=cf == null ? ""
					: (cf.getCompanyFullName() == null ? "" : cf
							.getCompanyFullName())%>"
										id="companyFullName" />
									<p />
									发票抬头将与公司名称一致，请注意正确填写
									<div>
								</td>
							</tr>
							<tr>
								<td valign="top" class="pad_3" width="50%">

									<strong>通信地址&nbsp;*</strong>
									<br />
									<p>

										<input name="address" size="25" class="bd" maxlength="100"
											value="<%=cf == null ? "" : cf.getCompanyAddress()%>"
											id="address" />
									</p>
									<div class="note">
										必须与网站上出现的联系地址一致
									</div>
								</td>
								<td valign="top" class="pad_3">

									<strong>邮政编码</strong>
									<br />
									<p>
										<input id="postcode" maxlength="6" name="companyZipcode"
											class="bd" size="12"
											value="<%=cf == null ? "" : cf.getCompanyZipCode()%>" />
									</p>
									<p class="error"></p>
								</td>
							</tr>
							<tr>
								<td valign="top" class="pad_3" width="50%">
									<strong>联系电话&nbsp;*</strong>
									<br />
									<p>
										<input name="adminTel1" size="5" class="bd" maxlength="10"
											value="<%=cf == null ? "" : (cf.getAdminTel1() == null ? ""
					: cf.getAdminTel1())%>" />

										-
										<input name="adminTel2" size="14" class="bd" maxlength="50"
											value="<%=cf == null ? "" : (cf.getAdminTel2() == null ? ""
					: cf.getAdminTel2())%>" />
									</p>
									<p class="error"></p>
									<div class="note">
										必须与网站上出现的联系电话一致，如有多个请用逗号隔开
									</div>
								</td>
								<td valign="top" class="pad_3">
									<strong>传真号码</strong>
									<br />
									<p>
										<input name="adminFax1" size="5" class="bd" maxlength="10"
											value="<%=cf == null ? "" : (cf.getAdminFax1() == null ? ""
					: cf.getAdminFax1())%>" />
										-
										<input name="adminFax2" size="14" class="bd" maxlength="90"
											value="<%=cf == null ? "" : (cf.getAdminFax2() == null ? ""
					: cf.getAdminFax2())%>" />
									</p>
									<p class="error"></p>
								</td>
							</tr>

							<!-- BLOCK: 大客户合同号 -->


							<!-- BLOCK: 代理管辖地域块 -->


						</table>
						<table border="0" cellspacing="0" cellpadding="0" width="100%">

							<tr>
								<td colspan="2" valign="top" class="pad_3">
									<p class="error"></p>

									<input type="hidden" name="protocolshow" value="1" />
								</td>
							</tr>
							<tr>
								<td height="30" colspan="2">
									<br />
									<input type="hidden" name="stage" value="1" />
									<input type="hidden" name="update" value="true" />
									<input type="submit" class="but3" name="stage" value="更新"/>
									<br />
									<br />
								</td>
							</tr>
						</table>
					</form>
<jsp:include page="../footer.jsp"></jsp:include>
	</body>
</html>
